<?php

use App\Http\Controllers\ExpertController;
use App\Http\Controllers\SurveyController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\VideoController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/login',[UserController::class,'login'])->name('login');//后台登录页面
Route::post('/login',[UserController::class,'doLogin']);//后台登录逻辑处理
Route::get('/logout',[UserController::class,'logout'])->middleware('auth');//后台注销页面

Route::get('/',[UserController::class,'index']);//前台首页

//Route::resource('/user',UserController::class);//用户
//Route::resource('/expert',ExpertController::class);//专家
//Route::resource('/video',VideoController::class);//音频

Route::get('/conf',[ExpertController::class,'conf']);//名师讲堂

Route::get('/review',[VideoController::class,'review']);//前台往期视频
Route::get('/review/review_info/{id}',[VideoController::class,'show']);//往期音频详情

Route::get('/expert',[ExpertController::class,'front_expert']);//名家风采
Route::get('/expert/info/{id}',[ExpertController::class,'show_expert']);//名家详情

Route::get('/adm',[SurveyController::class,'admin'])->middleware('auth');//后台首页
Route::prefix('/adm')->middleware('auth')->group(function (){

    Route::get('/user',[UserController::class,'list_adm']);//后台用户列表页
    Route::get('/user/add-user',[UserController::class,'create']);//新增用户
    Route::post('/user/add-user',[UserController::class,'store']);//新增用户处理逻辑
    Route::get('/user/change-password/{id}',[UserController::class,'edit']);//修改密码
    Route::post('/user/change-password/{id}',[UserController::class,'update']);//修改密码处理逻辑
    Route::delete('/user/destroy/{id}',[UserController::class,'destroy']);//删除用户

    Route::get('/expert',[ExpertController::class,'list']);//后台专家列表页
    Route::get('/expert/add',[ExpertController::class,'create']);//新增专家
    Route::post('/expert/add',[ExpertController::class,'store']);//新增专家处理逻辑
    Route::get('/expert/edit/{id}',[ExpertController::class,'edit']);//编辑专家
    Route::post('/expert/edit/{id}',[ExpertController::class,'update']);//编辑专家处理逻辑
    Route::delete('/expert/destroy',[ExpertController::class,'destroy']);//删除专家



    Route::get('/video/video-list',[VideoController::class,'index']);//后台直播录播列表页
    Route::get('/video/add-video',[VideoController::class,'create']);//新增视频
    Route::post('/video/add-video',[VideoController::class,'store']);//新增视频处理逻辑
    Route::get('/video/edit/{id}',[VideoController::class,'edit']);//编辑视频
    Route::post('/video/edit/{id}',[VideoController::class,'update']);//编辑视频处理逻辑
    Route::delete('/video/destroy/{id}',[VideoController::class,'destroy']);//删除视频

});


